
// let a = {};
let object = {
  name: 'mike',
  age: '19',
}
// let b = Object.prototype;

// let res = [a.prototype === b, Object.getPrototypeOf(a) == b]  //false  true


function getName () {
    return object.name
}
let arr = [1, 2, 3, 5 ,8 ,6 ,0 ,9 ]

// console.log(Object.prototype === b);
console.log(Object.getPrototypeOf(object));
console.log(Object.prototype);
console.log(getName.prototype, Object.getPrototypeOf(getName));
console.log(arr.prototype, Object.getPrototypeOf(arr));


/**
 * 
 * * 首先你要明白，任何函数都是 Function 的实例，
 * * 而p是函数 Person 的实例，Object.getPrototypeOf 会获取构造当前对象的原型。
 * * 所以 Object.getPrototypeOf(p) === Person.prototype，
 * * 而 Object.getPrototypeOf(Person) === Function.prototype，
 */

 function Person() {}
 var p = new Person();
 
 var a = p.__proto__;
 var b = Object.getPrototypeOf(p);
 var c = Person.prototype;
 console.log(a === b, a === c, b === c);
 // true, true, true
 
 var d = Person.__proto__;
 var e = Object.getPrototypeOf(Person);
 var f = Function.prototype;
 console.log(d === e, d === f, e === f);
 // true, true, true